<template>
  <div style="height:100%">
    <div v-if="!canViewTask" class="no-auth">
      <img :src="noAuthImage" />
      <p class="desc">{{$t('common.base.tip.noAuth')}}</p>
    </div>
    <div class="task-detail-container" v-if="canViewTask" v-loading="loading" ref="container">
      <div id="task-task-detail-view"></div>
       <!-- start 顶部操作区 -->
      <div class="task-detail-header" ref="header">
        <div class="task-detail-header-top" :class="{ active: !collapse }">
          <div class="collapse-btn"></div>
          <div class="customer-info-wrap"></div>
          <!-- start 顶部按钮组 -->
          <div class="task-detail-header-top-btn ">
            <template>
              <el-button v-if="canCancel" @click="cancelTask">{{$t('task.taskTypes.planTask.cancelTask')}}</el-button>
              <el-button v-if="canEdit" @click="editTask">{{$t('task.taskTypes.planTask.editTask')}}</el-button>
              <el-button v-if="canCopy" @click="copyTask">{{$t('task.taskTypes.planTask.copyTask')}}</el-button>
            </template>
          </div>
          <!-- end 顶部按钮组 -->
        </div>
      </div>
      <!-- end 顶部操作区 -->
      <!-- start 工单详情折叠面板 -->
      <div
        ref="TaskPlanDetailMainElement"
        class="task-detail-main"
        :class="{ normal: !collapsing }"
        @scroll="getScroll"
      >
        <base-collapse class="task-detail-main-content" :direction.sync="collapseDirection">
          <!-- start 工单详情 -->
          <template slot="left">
            <div class="task-detail-main-content-left" v-show="collapseDirection != 'left'">
              <el-tabs v-model="leftActiveTab">
                <el-tab-pane :label="$t('task.planTaskInfo')" name="task-plan-view">
                  <task-plan-view 
                    :plan-task="task" 
                    :fields="fields" 
                  />
                </el-tab-pane>
                <!-- 保持样式占位用无任何意义、不需要删除 s -->
                <el-tab-pane disabled>
                </el-tab-pane>
                <!-- 保持样式占位用无任何意义、不需要删除 e -->
              </el-tabs>
            </div>

            <div class="collapse-left" v-show="collapseDirection == 'left'">{{$t('task.taskInfo')}}</div>
          </template>
          <!-- end 工单详情 -->

          <!-- start 附加组件 -->
          <template slot="right">
            <div
              class="task-detail-main-content-right"
              v-show="collapseDirection != 'right'"
              v-loading="rightTabBarLoading"
            >
              <BaseBarV3
                :bar-list="tabBarList"
                :now-item="rightActiveTab"
                @changeItem="tabBarChangeItem"
                @upDateBarList="tabBarUpdateList"
              ></BaseBarV3>
              <task-plan-info-record
                ref="record"
                v-if="rightActiveTab == 'record'"
                :share-data="propsForSubComponents"
                :show-template="showTaskRecordTemplate"
              />
              <plantask-task-list
                ref="planTaskTaskList"
                v-if="rightActiveTab == 'planTaskTaskList'"
                :share-data="propsForSubComponents"
              />
            </div>
          </template>
        <!-- end 附加组件 -->
        </base-collapse>
      </div>
      <!-- end 工单详情折叠面板 -->
    </div>
  </div>
</template>

<script>
import TaskPlanTaskDetailView from './TaskPlanTaskDetailView';
export default TaskPlanTaskDetailView;
</script>
<style lang="scss">
@import './TaskPlanTaskDetailView.scss';
</style>

<style lang="scss">
.no-auth{
  padding-top: 10%;
  text-align: center;
  img {
    width: 160px;
    height: 160px;
  }
  .desc {
    margin-top: 8px;
    color: $text-color-regular;
  }
}
.task-detail-container {
    .v-step[data-v-7c9c03f0] {
        background: #fff !important;
        color: #333 !important;
        -webkit-filter: drop-shadow(0px 9px 28px 8px rgba(0, 0, 0, 0.05)) !important;
        filter: drop-shadow(0px 9px 28px 8px rgba(0, 0, 0, 0.05)) !important;
        padding: 0 !important;
        min-width: 240px !important;
        max-width: 350px !important;
    }

    .v-step .v-step__arrow[data-v-7c9c03f0] {
        border-color: #fff !important;
        border-left-color: transparent !important;
        border-right-color: transparent !important;
    }
    .v-tour-content-box {
    position: relative;
    overflow: hidden;
    padding: 0 20px;
    border-radius: 4px;
    .v-tour-left-tips {
      width: 80px;
      height: 32px;
      background: $color-primary;
      color: #fff;
      position: absolute;
      left: -40px;
      top: 0px;
      line-height: 40px;
      font-size: 12px;
      transform-origin: center top;
      transform: rotateZ(-45deg);
      text-align: center;
    }
    .v-tour-content {
      .v-tour-content-head {
        padding-top: 32px;
        padding-bottom: 10px;
        .iconfont {
          font-size: 10px;
          margin-bottom: 2px;
          color: #999;
          cursor: pointer;
        }
      }
      .v-tour-content-con {
        text-align: start;
        padding-bottom: 12px;
      }
    }
  }

  .v-tour-bottom {
    height: 52px;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    .btns {
      width: 60px;
      height: 28px;
      background: $color-primary;
      color: #fff;
      text-align: center;
      line-height: 28px;
      border-radius: 4px;
    }
    .text {
      @include fontColor();
    }
    :nth-child(n) {
      cursor: pointer;
    }
    :not(:last-child) {
      margin-right: 12px;
    }
  }

  /* 向上的箭头 */

  .normal-arrow-top {
    font-size: 0;
    line-height: 0;
    border-width: 0.5rem;
    border-color: #fff;
    width: 0;
    border-top-width: 0;
    border-style: dashed;
    border-bottom-style: solid;
    border-left-color: transparent;
    border-right-color: transparent;
    position: absolute;
    top: -0.5rem;
  }
    .guide-model-box {
        position: fixed;
        width: 100%;
        height: 100vh;
        top: 0;
        left: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 996;
    }

    .guide-point {
        z-index: 997;
        position: sticky;
    }

    .bg-w {
        background: #fff;
    }

    .task-detail-step-2-box {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 997;

        .task-detail-step-2 {
            width: 104px;
            height: 40px;
            display: flex;
            justify-content: center;
            align-items: center;
            top: 0;
            left: 0;
            position: absolute;
            background: transparent;
        }
    }
}
.form-view-row-content-address{
  cursor: pointer;
}
.form-view-row-content-address:hover{
  color: $color-primary-light-6;
 }
 .Add{
  color: #13c2c1;
  cursor: pointer;
 }
 // 选人控件和引导层级调整
#pull-group-guide .tour-content-out-box{
  z-index: 10000;
}
</style>



